def txt = textArea.selectedText.trim()
def size = 30
def border = "_/" * (size + 2)
textArea.selectedText = border + "\n" + "_/" + txt.center(size*2 - txt.bytes.size() + txt.size(), ' ') + "_/\n" + border